package com.bruan.d1_io;

import java.io.*;

public class FileInputStreamTest2 {
    public static void main(String[] args) throws IOException {
        //管道
        InputStream f = new FileInputStream("file-io-app\\bruan.txt");
        //每次读取多个字节
        byte[] buffer = new byte[4];//创建一个桶
        int len = f.read(buffer);//返回读出字节数len
        String s = new String(buffer);//将桶翻译
        System.out.println(s);
        System.out.println(len);

        int len2 = f.read(buffer);
        String s1 = new String(buffer);
        System.out.println(s1);
        System.out.println(len2);
        int len3 = f.read(buffer);
        String s2 = new String(buffer);
        System.out.println(s2);
        System.out.println(len3);
    }
}
